package video.com.text;


import android.widget.Toast;

import com.huamai.poc.IPocEngineEventHandler;
import com.huamai.poc.PocEngine;
import com.huamai.poc.PocEngineFactory;
import com.unionbroad.app.PocApplication;

public class MyApp extends PocApplication {

    @Override
    public void onCreate() {
        super.onCreate();

        PocEngine.Configure configure = new PocEngine.Configure();
//        configure.ip = "123.57.6.84";
//        configure.port = "5060";

        configure.ip = "192.168.1.136";
        configure.port = "6050";
        PocEngineFactory.initialize(this, configure);

        PocEngineFactory.initialize(this);
        PocEngineFactory.get().addEventHandler(mPocEventHandler);
    }

    private final IPocEngineEventHandler mPocEventHandler = new IPocEngineEventHandler() {

        @Override
        public void onIncoming(long sessionId, int type, long uid, String extra) {
            Toast.makeText(getContext(), "来电", Toast.LENGTH_SHORT).show();
        }
    };
}
